import request from '@/utils/request'

// 封装获取所有权限列表

export const getPermissionsList = params => request({
  url: '/permissions',
  params
})

// 封装根据id删除权限点

export const deletePermissions = (id) => request({
  url: '/permissions/' + id,
  method: 'delete'
})

// 封装新建权限点接口

export const addPermissions = data => request({
  url: '/permissions',
  method: 'post',
  data
})

// 根据id获取权限点信息
export const detailPermissions = id => request({
  url: '/permissions/' + id,
  method: 'get'
})

// 根据id编辑权限点信息
export const editPermissions = data => request({
  url: '/permissions/' + data.id,
  data,
  method: 'put'
})

// 封装获取全部权限点数量

export const countPermissions = () => request({
  url: '/permissions/count',
  method: 'get'
})
